#include"List.h"
using namespace std;
//void test()
//{
//	ys::list<int> lt1;
//	lt1.push_back(1);
//	lt1.push_back(1);
//	lt1.push_back(1);
//	lt1.push_back(1);
//	ys::list_iterator<int> it1 = lt1.begin();
//	while (it1 != lt1.end())
//	{
//		cout << *it1 << " ";
//		++it1;
//	}
//	cout << endl;
//	for (auto e : lt1)
//	{
//		cout << e << " ";
//	}
//	cout << endl;
//}

void test1()
{
	ys::list<int> lt1(6, 10);
	ys::list<int>::iterator it1 = lt1.begin();
	while (it1 != lt1.end())
	{
		cout << *it1 << " ";
		++it1;
	}
	cout << endl;
}

void test2()
{
	const ys::list<int> lt1(10, 1);
	ys::list<int>::const_iterator it1 = lt1.begin();
	while (it1 != lt1.end())
	{
		cout << *it1 << " ";
		++it1;
	}
	cout << endl;
}

void test3()
{
	ys::list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_front(0);
	lt1.push_front(-1);
	ys::list<int>::iterator it1 = lt1.begin();
	while (it1 != lt1.end())
	{
		cout << *it1 << " ";
		++it1;
	}
	cout << endl;
}

void test4()
{
	ys::list<int> lt1(6, 10);
	ys::list<int> lt2(lt1);
	ys::list<int>::iterator it1 = lt2.begin();
	while (it1 != lt2.end())
	{
		cout << *it1 << " ";
		++it1;
	}

	//for (auto e : lt2)
	//{
	//	cout << e << " ";
	//}
	cout << endl;
}

void test5()
{
	ys::list<int> lt1(6, 10);
	ys::list<int> lt2;
	lt2 = lt1;
	ys::list<int>::iterator it1 = lt2.begin();
	while (it1 != lt2.end())
	{
		cout << *it1 << " ";
		++it1;
	}
	cout << endl;
}

void test6()
{
	ys::list<int> lt1(6, 10);
	ys::list<int> lt2(5,20);
	for (auto e : lt2)
	{
		cout << e << " ";
	}
	cout << endl;
	lt1.swap(lt2);
	for (auto e : lt2)
	{
		cout << e << " ";
	}
	cout << endl;
	ys::swap(lt1, lt2);
	for (auto e : lt2)
	{
		cout << e << " ";
	}
	cout << endl;
}

int main()
{
	test6();
	return 0;
}